package com.coolwen.springmvc.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * @author CoolWen
 * @version 2020-05-21 9:04
 */
public class BaseWebInit extends AbstractAnnotationConfigDispatcherServletInitializer {
    @Override
    protected Class<?>[] getRootConfigClasses() {
        System.out.println("------------init root config------------");
        return new Class<?>[]{RootConfig.class};
    }

    @Override
    protected Class<?>[] getServletConfigClasses() {
        System.out.println("------------init web config------------");
        return new Class<?>[]{WebConfig.class};
    }

    @Override
    protected String[] getServletMappings() {
        System.out.println("------------init mapping------------");
        return new String[]{"/"};//项目中所有路径都会被springmvc拦截
    }
}
